/*
 * @Description: 流程 - 接口
 * @Author: DHL
 * @Date: 2022-08-19 15:43:19
 * @LastEditors: DHL
 * @LastEditTime: 2022-12-23 15:21:52
 */

import { $get, $post } from '/@/utils/http'
import { FlowProcessStartParams, FlowProcessStartResultModel } from './model/flowProcessStartModel'
import { ContentTypeEnum } from '/@/constant/http'
import { Result } from '/@/model/baseModel'

/**
 * 根据流程启动参数查询用户任务
 * @param searchParams
 * @returns
 */
export const apiFlowProcessSearchUserTask = (searchParams: FlowProcessStartParams) =>
  $post<FlowProcessStartResultModel>({
    url: '/flowProcess/searchUserTask',
    contentType: ContentTypeEnum.json,
    params: searchParams
  })

/**
 * 任务完成
 * @param submitParams
 * @returns
 */
export const apiFlowTaskComplete = (submitParams: any) =>
  $post<Result<string>>({
    url: '/flowProcess/complete',
    contentType: ContentTypeEnum.json,
    params: submitParams
  })
